package com.mail1.controller;

import com.mail1.model.Mail;
import com.mail1.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author vito
 * @version 1.0
 */
@RestController

public class MailController {
    @Autowired
    MailService mailService;

    @ResponseBody
    @PostMapping("/sendSimpleMail")
    public String sendSimpleMailer(@RequestBody Mail mail) {
        mailService.sendSimpleMailMessage(mail);
        return "简单邮箱发送成功！";
    }
}
